package com.zzx.threekingdom.resmanager;

import com.zzx.threekingdom.R;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;

import java.util.HashMap;

public class ResBitmapLib
{
    HashMap<String, Bitmap> map = new HashMap<String, Bitmap>();
    
    public static final int CARD_WIDTH = 73;
    public static final int CARD_HEIGHT = 103;
    
    public String mapName[] = {
            "back"
            , "杀"
            , "闪"
            , "桃"
            
            , "刘备"
            , "关羽"
            , "张飞"
            , "诸葛亮"
            , "赵云"
            , "马超"
            , "黄月英"
            
            , "孙权"
            , "甘宁"
            , "吕蒙"
            , "黄盖"
            , "周瑜"
            , "大乔"
            , "陆逊"
            , "孙尚香"
            
            , "曹操"
            , "司马懿"
            , "夏侯敦"
            , "张辽"
            , "许褚"
            , "郭嘉"
            , "甄姬"
            
            , "华佗"
            , "吕布"
            , "貂蝉"
            
            , "赤兔"
            , "大宛"
            , "的卢"
            , "绝影"
            , "爪黄飞电"
            , "紫骍"
            
            , "八卦阵"
            , "雌雄双股剑"
            , "方天画戟"
            , "贯石斧"
            , "寒冰剑"
            , "麒麟弓"
            , "青釭剑"
            , "青龙偃月刀"
            , "仁王盾"
            , "丈八蛇矛"
            , "诸葛连弩"
            
            , "闪电"
            , "乐不思蜀"
            , "无懈可击"
            , "借刀杀人"
            , "五谷丰登"
            , "无中生有"
            , "决斗"
            , "桃园结义"
            , "南蛮入侵"
            , "万箭齐发"
            , "顺手牵羊"
            , "过河拆桥"
            
          };
    
    public int mapResid[] = {
            R.drawable.back
            , R.drawable.basecard_kill
            , R.drawable.basecard_evade
            , R.drawable.basecard_peach
            
            , R.drawable.character_liubei
            , R.drawable.character_guanyu
            , R.drawable.character_zhangfei
            , R.drawable.character_zhugeliang
            , R.drawable.character_zhaoyun
            , R.drawable.character_machao
            , R.drawable.character_huangyueying
            
            , R.drawable.character_sunquan
            , R.drawable.character_ganning
            , R.drawable.character_lvmeng
            , R.drawable.character_huanggai
            , R.drawable.character_zhouyu
            , R.drawable.character_daqiao
            , R.drawable.character_luxun
            , R.drawable.character_sunshangxiang
            
            , R.drawable.character_caocao
            , R.drawable.character_simayi
            , R.drawable.character_xiahoudun
            , R.drawable.character_zhangliao
            , R.drawable.character_xuchu
            , R.drawable.character_guojia
            , R.drawable.character_zhenji
            
            , R.drawable.character_huatuo
            , R.drawable.character_lvbu
            , R.drawable.character_diaochan
            
            , R.drawable.chitu
            , R.drawable.dawan
            , R.drawable.dilu
            , R.drawable.jueying
            , R.drawable.zhuahuangfeidian
            , R.drawable.zixing
            
            , R.drawable.baguazhen
            , R.drawable.cixiongshuanggujian
            , R.drawable.fangtianhuaji
            , R.drawable.guanshifu
            , R.drawable.hanbingjian
            , R.drawable.qilingong
            , R.drawable.qinggangjian
            , R.drawable.qinglongyanyuedao
            , R.drawable.renwangdun
            , R.drawable.zhangbashemao
            , R.drawable.zhugeliannu
            
            , R.drawable.shandian
            , R.drawable.lebusishu
            , R.drawable.wuxiekeji
            , R.drawable.jiedaosharen
            , R.drawable.wugufengdeng
            , R.drawable.wuzhongshengyou
            , R.drawable.juedou
            , R.drawable.taoyuanjieyi
            , R.drawable.nanmanruqin
            , R.drawable.wanjianqifa
            , R.drawable.shunshouqianyang
            , R.drawable.guohechaiqiao
    };

    
    
 
    
    
    
    
    public ResBitmapLib()
    {
        
    }
    public static ResBitmapLib lib = new ResBitmapLib(); 
    
    public void loadRes(Resources res)
    {
        Options options = new Options();
        options.inPurgeable = true;
        options.inDither = false;
        int len = Math.min(mapResid.length, mapName.length);
        for(int count = 0;count < len;count++)
        {
            Bitmap bitmap = BitmapFactory.decodeResource(res, mapResid[count], options);
            String name = mapName[count];
            map.put(name, bitmap);
        }
    }
    
    public Bitmap getMap(String name)
    {
        return map.get(name);
    }
    
    public void clean()
    {
        
    }
}
